package com.dongchen.designpatter.chapter04.simplefactory.sample02;

import lombok.extern.slf4j.Slf4j;

/**
 * @author dongchen
 * @time 2021/9/17
 */
@Slf4j
public class Client {
    public static void main(String[] args) {
        try {
            User user;
            UserMapper mapper = new UserMapper();
            int permission = mapper.findPermission("zhangsan", "123456");
            user = UserFactory.getUser(permission);
            user.sameOperation();
            user.diffOperation();
        } catch (Exception e) {
            log.error("there is produced some error , the message is {}", e.getMessage(), e);
        }
    }
}
